/* 原型可以用来解决内存空间的浪费 */

function User(name, age) {
    this.name = name
    this.age = age
}


User.prototype.sayHi = function () {
    console.log('hi我是', this.name, '我今年', this.age);
}



var u1 = new User('kingsen', 18)
var u2 = new User('lixin', 19)

u1.sayHi()
u2.sayHi()

var obj = {
    name: "xinxin",
    age: 18
}

